import axios from 'axios'
import React, { Component } from 'react'
import './index.css'

export default class Student extends Component {
    getStudentData = () => {
        const url = "http://localhost:3000/api1/search/users2"
        axios.get(url).then(
            res => {
                console.log(res.data)
            },error=> {console.log('失败了')}
        )
    }

    render() {
        return (
            <div className="student">
                <button onClick={this.getStudentData}>点我获取学生数据</button>
            </div>
        )
    }
}
